Code Monkey home page Code Monkey logo

vscode-deploy-azure's Introduction

Build Status

Deploy to Azure from Visual Studio Code

Get it on the Visual Studio Code Marketplace!

πŸ“’ β›” ATTENTION!! - Deprecation notice

This extension is being deprecated and will not be supported. Please see details here.


This Visual Studio Code extension helps you set up continuous build and deployment for Azure App Service or for Azure Kubernetes Service without leaving Visual Studio Code.

Configure CI/CD Pipeline Demo

To set up a pipeline, choose Deploy to Azure: Configure CI/CD Pipeline from the command palette (Ctrl/Cmd + Shift + P) or right-click in the file explorer. The guided workflow will generate a starter YAML file defining the build and deploy process.

You can customize the pipeline using all the features offered by Azure Pipelines and GitHub Actions.

Once the setup is completed, an automatic CI/CD trigger will fire for every code push. To set this up, if you have using GitHub as the repository the extension will ask for a GitHub PAT with repo and will configure GitHub Actions.

GitHub PAT scope

You can refer to our tutorial for more details on the extension.

Telemetry

Visual Studio Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don’t wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.

Troubleshooting failures

  • Failed to determine Azure Repo details from remote url: If you're configuring a pipeline for a Git repository backed by Azure Repos, ensure that it has a remote pointing to a valid Azure Repos Git repo URL.

Contributing

See CONTRIBUTING.md if you want to jump in!

For TSLint to work in VSCode, run npm install and restart VSCode.

Testing framework

For adding test, create test files with extension .test.ts inside src/configure/test/suite.

For running all the tests, use the command npm test.

vscode-deploy-azure's People

Contributors

anuragc617 avatar atbagga avatar bishal-pdmsft avatar ddivanshu avatar dependabot[bot] avatar dikhakha avatar hiyadav avatar issacnitinmsft avatar ja-04 avatar kanika1894 avatar microsoftopensource avatar ninadkavimandan avatar pulkitaggarwl avatar t-dedah avatar tejasd1990 avatar tiwarishub avatar vineetmimrot avatar vinodkumar3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-deploy-azure's Issues

GitHub repo creation not working on mac OS

It fails with error:
error: unknown switch `U' usage: git remote add [] -f, --fetch fetch the remote branches --tags import all tags and associated objects when fetching or do not fetch any tag at all (--no-tags) -t, --track branch(es) to track -m, --master master branch --mirror[=(push|fetch)] set up remote as a mirror to push to or fetch from

[VSCode on windows] During the commit of workflow file, it returns LF error

For the first time, git installed user, the extension will give the following error while committing the workflow file:

"Commit failed due to error: fatal: LF would be replaced by CRLF in .github/workflows/workflow.yml"

It has two solutions:

  1. The user runs below command to enable git to convert CRLF to LF
    git config --global core.safecrlf false

  2. Our extension should convert the workflow file to the Unix format. In javascript we can run
    the_string.replace(/\r\n/g, "\n"); to convert to LF

Extension causes high cpu load

  • Issue Type: Performance
  • Extension Name: azure-deploy
  • Extension Version: 1.0.5-pr-75-5e64aa7
  • OS Version: Darwin x64 19.4.0
  • VSCode version: 1.44.0

⚠️ Make sure to attach this file from your home-directory:
⚠️/Users/vineetmimrot/ms-vscode-deploy-azure.azure-deploy-unresponsive.cpuprofile.txt

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load
ms-vscode-deploy-azure.azure-deploy-unresponsive.cpuprofile.txt

Failed to Render

Tried deploying a .NET 5 Application to App Service and got the following error

Pipeline provisioning job failed with error: 'Error=Failed to render: Evaluation error: Helper 'beginsWith' called with wrong number of arguments, needed 5 but got 0 Current node: Expr{Path:Path{Original:'beginsWith', Pos:3}, Pos:0}, Message=Mustache parsing failed'

No other errors in logs

Here is a repo to test

https://github.com/isaacrlevin/.NET-Conf-Demos/tree/main/AppService

Support virtual workspaces

πŸ‘‹ Hi there, Martin here, from the VS Code team.

Recently we've announced the Remote Repository feature that lets you browse and edit files and folders directly on GitHub.

Open Remote Repository... opens VSCode on a folder or workspace located on a virtual file system. We call this a virtual workspace. We observed that not all extension support this well, either because they can not, or they haven't thought about it.

It would be fantastic if you could test whether your extension can handle virtual workspaces:

Check out the Virtual Workspaces Extension Author Guide on how to do that.

When done, set the new virtualWorkspaces capability in your 'package.json'.

{
  "capabilities": {
    "virtualWorkspaces": true | false
  }
}
  • Use "virtualWorkspaces": true if your extension is prepared for virtual workspaces
  • Use "virtualWorkspaces": false if your extension should be disabled when a virtual workspace is opened

For questions and comments please use the Virtual Workspaces Tracking Issue.

Thanks for the support and the great work! ❀️

Azure-Pipeline trigger doesn't work when branch has non alphabetic characters

If the branch on which the pipeline is configured has non alphabetic characters, then the trigger doesn't work as the mustache renderer changes while html escaping them.
Hence it gets converted like this in azure-pipelines.yaml:
orignal branch name: users/hiyada/bugFile
converted branch name: users/hiyada/bugFile

Support Workspace Trust

Hello πŸ‘‹ I'm from the VS Code team.

Recently, we have been exploring a security feature we refer to as Workspace Trust. This feature is intended to centralize and unify a security conscious decision required by a variety of VS Code features. With workspace trust, the user will be able to declare whether or not they trust the folder that is opened in VS Code before these features are executed.

Why you should care

Your extension is incredibly popular with VS Code users! We want to make sure that those users have a delightful experience with workspace trust and that includes extension authors deciding how much of their extension is supported in an untrusted workspace.

Workspace Trust experience

You can enable the feature with the following setting security.workspace.trust.enabled. Once enabled, you will see the following dialog when opening folders in VS Code.

Workspace Trust Startup Dialog

This dialog is important for allowing the user to make a decision early and understand the impact of their decision. Once you understand the feature, you may want to customize when to display the dialog using the setting security.workspace.trust.startupPrompt.

You can follow the development of Workspace Trust and provide feedback in issue #106488.

Workspace trust API

First off, all of what I am about to say can be found in issue #120251. That issue will include discussion of the feature and any updates to the feature.

The Workspace Trust extension API is now in stable. This allowed us to release the first cut of our guide for onboarding your extension to Workspace Trust. The API is small, so here is a quick look.

You can declare your extension to provide complete, partial or no support in untrusted workspaces using the untrustedWorkspaces capability in package.json.

The following example declares that the extension is supported completely in untrusted workspaces. In this case, the extension is enabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": true
  }
}

The next example declares that the extension is not supported in untrusted workspaces. In this case, the extension is disabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": false
  }
}

The third option is to declared limited support. There are three tools provided to you when you select the limited option.

First, if you have a setting that can be configured in the workspace but requires the workspace to be trusted in order to apply the workspace value, then you can include the setting using restrictedConfigurations array property in untrustedWorkspaces object. Doing so, VS Code will ignore the workspace value of these restricted settings when your extension reads these settings values using the VS Code Workspace Configuration API.

The following example declares the settings that are restricted in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": "limited",
    "restrictedConfigurations": [
      "markdown.styles"
    ]
  }
}

Next, you can also check and listen if the current workspace is trusted or not programmatically using the following API:

export namespace workspace {
  /**
   * When true, the user has explicitly trusted the contents of the workspace.
   */
  export const isTrusted: boolean;
  /**
   * Event that fires when the current workspace has been trusted.
   */
  export const onDidGrantWorkspaceTrust: Event<void>;
}

Lastly, you can hide commands or views declaratively with the isWorkspaceTrusted context key in your when clauses.

A far more detailed guide on how to onboard which will be updated as we receive feedback can be found in issue #120251.

Rollout plan

Workspace Trust will remain disabled for the month of May, but we are planning on enabling this by default in the future. To prepare for that day, we would love for you to try it out and provide feedback.

We'd love your feedback

Since this issue was created in an automated fashion, we won't be monitoring the responses in this issue (our notifications would explode!). Instead we ask you to drop questions, and feedback in issue #120251 as we've mentioned above.

We're excited to see what you do with workspace trust!

404: Repo is private

This repo is private. However the blog post (https://azure.microsoft.com/en-us/blog/new-deploy-to-azure-extension-for-visual-studio-code/) and marketplace page (https://marketplace.visualstudio.com/items?itemName=ms-vscode-deploy-azure.azure-deploy) contain links to this repo. These only work for authorized Microsoft internal users. Anonymous or non-authorized users get a 404 error.

Steps to reproduce:
Use a browser that is not signed in to GitHub (anonymous) or signed as a user without access to the Microsoft org.

Suggested fix:
Open up the repo (or remove the public links)

Attention: Deprecation notice

Hi! Please note that this extension is being deprecated and will be removed from VS code marketplace on 11 April 2022.

This also means that "Configure CI/CD Workflow" and "Browse CI/CD Workflows" option will no longer be available on Azure Kubernetes Service extension.

Please move your workloads away from the extension before 11 April 2022.

As an alternative, you may choose to use Starter workflows from GitHub to quickly onboard your application to GitHub Actions. You may alternatively choose to use Create file API to create a Actions workflow file and Secrets API to create pre-requisites deployment secrets.

using python workflow from template service causes unwanted manifest files to be added to web app folders

Description-
Template service has been updated with python support for linux web app.
PR link
vs code-deploy-azure repo was configured locally to fetch the newly added template for python locally. Using these changes
the template got fetched and was committed to repo successfully. But after the workflow gets committed oryx build manifest files are also getting added to the web app folder structure. These files are not being added by workflow run and also cause the run to fail.

Steps -

  • Run template service locally
  • Run provisioning service locally
  • configure vscode-deploy-azure repo with given patch link to patch
  • Build and run vs code repo and use deploy to azure option -"command+shift+p"
  • select a python repo- sample repo
  • from the list of template options select "Python to App Service" (the newly added template in template service)
  • select rest options as required. python version(select any), startup command(default empty)
  • the workflow gets committed succsessfully.
  • Check the web app folder structure by hitting the url of the web app.
  • We can see extra files being added to the structure which are not being caused by workflow.
  • To confirm that this is not a workflow issue and vs code specific issue following steps were taken
    -> The workflow in template service was shortened to just checkout action. Expectation here is that it won't run anything and app folder will be empty.But still these files were being added after committing.video link
    -> the same process was done using postman where workflow was fetched and committed by making call to provisioning service apis. In this case workflow got committed as before and also no extra files were added .

We suspect that vs code is tweaking some properties in web app causing these files to be added .This requires More investigation.

Extension issue

  • Issue Type: Bug
  • Extension Name: azure-deploy
  • Extension Version: 1.2.2
  • OS Version: Windows_NT x64 10.0.19042
  • VSCode version: 1.54.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Extension issue

  • Issue Type: Bug
  • Extension Name: azure-deploy
  • Extension Version: 1.2.2
  • OS Version: Windows_NT x64 10.0.19041
  • VSCode version: 1.54.3

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

No Azure DevOps organization can't accept

Hello, teams.

I think this extension is very helpful and nice.

I've been trying to configure "Deploy to Azure Configure CI/CI Pipeline"
After choosing the target of Azure subscription and web app, I can't proceed at all.
Any organization of my Azure DevOps can't accept like below.

image

I've tried another organization also, but the result was the same.
How can I solve this issue?

Support Workspace Trust

Hello πŸ‘‹ I'm from the VS Code team.

Recently, we have been exploring a security feature we refer to as Workspace Trust. This feature is intended to centralize and unify a security conscious decision required by a variety of VS Code features. With workspace trust, the user will be able to declare whether or not they trust the folder that is opened in VS Code before these features are executed.

Why you should care

Your extension is incredibly popular with VS Code users! We want to make sure that those users have a delightful experience with workspace trust and that includes extension authors deciding how much of their extension is supported in an untrusted workspace.

Workspace Trust experience

You can enable the feature with the following setting security.workspace.trust.enabled. Once enabled, you will see the following dialog when opening folders in VS Code.

Workspace Trust Startup Dialog

This dialog is important for allowing the user to make a decision early and understand the impact of their decision. Once you understand the feature, you may want to customize when to display the dialog using the setting security.workspace.trust.startupPrompt.

You can follow the development of Workspace Trust and provide feedback in issue #106488.

Workspace trust API

First off, all of what I am about to say can be found in issue #120251. That issue will include discussion of the feature and any updates to the feature.

The Workspace Trust extension API is now in stable. This allowed us to release the first cut of our guide for onboarding your extension to Workspace Trust. The API is small, so here is a quick look.

You can declare your extension to provide complete, partial or no support in untrusted workspaces using the untrustedWorkspaces capability in package.json.

The following example declares that the extension is supported completely in untrusted workspaces. In this case, the extension is enabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": true
  }
}

The next example declares that the extension is not supported in untrusted workspaces. In this case, the extension is disabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": false
  }
}

The third option is to declared limited support. There are three tools provided to you when you select the limited option.

First, if you have a setting that can be configured in the workspace but requires the workspace to be trusted in order to apply the workspace value, then you can include the setting using restrictedConfigurations array property in untrustedWorkspaces object. Doing so, VS Code will ignore the workspace value of these restricted settings when your extension reads these settings values using the VS Code Workspace Configuration API.

The following example declares the settings that are restricted in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": "limited",
    "restrictedConfigurations": [
      "markdown.styles"
    ]
  }
}

Next, you can also check and listen if the current workspace is trusted or not programmatically using the following API:

export namespace workspace {
  /**
    * When true, the user has explicitly trusted the contents of the workspace.
    */
  export const isTrusted: boolean;
  /**
    * Event that fires when the current workspace has been trusted.
    */
  export const onDidGrantWorkspaceTrust: Event<void>;
}

Lastly, you can hide commands or views declaratively with the isWorkspaceTrusted context key in your when clauses.

A far more detailed guide on how to onboard which will be updated as we receive feedback can be found in issue #120251.

Rollout plan

Workspace Trust will remain disabled for the month of May, but we are planning on enabling this by default in the future. To prepare for that day, we would love for you to try it out and provide feedback.

We'd love your feedback

Since this issue was created in an automated fashion, we won't be monitoring the responses in this issue (our notifications would explode!). Instead we ask you to drop questions, and feedback in issue #120251 as we've mentioned above.

We're excited to see what you do with workspace trust!

Analyzing your repository hanging

Does not access github. No logs. No feedback.
PAT key copied from Github and entered when requested by extension.
"Analyzing your repository" hanging forever.
Doesn't access Github using the key. Key never used.
What's the problem?
Documentation wrong?
It seems this extension doesn't work as intended.

Thanks

When deploying Angular App to Azure (using 'Deploy to Azure' extension) environment.ts settings are replaced

When deploying an Angular App to Azure (using the 'Deploy to Azure' extension), a setting ('domainApi', in the below environments file) is not being used whenever its accessed in the app.

export const environment = { production: true, domainApi: 'https://myapi.azurewebsites.net' };

It's being replaced with the url of the app im deploying to Azure (i.e. mysite.azurewebsites.net), so im getting a 404 as the apis are on myapi.azurewebsites.net, not mysite.azurewebsites.net. No where in my code do i do this

Could anyone please suggest how I get the Angular app to retrieve the correct setting from the environment.ts file?

Note, the settings in all the enviroments are the same so its not being overwritten by another environments file.

Thanks in advance.

.NET 6 GitHub Actions Support?

Looking at the templates for Github Actions it looks like there aren't templates for .NET. It would be great to have this as non-Windows .NET devs don't have options to generate workflows (you can do this for Visual Studio in Windows)

Consider depending on VSCode-YAML rather than directly on yaml-language-server

Hi,

from looking into your repository it looks like you use the yaml language server directly rather than relying on VSCode-YAML for the YAML support. I was wondering if there is any particular reason why you spawn up the language server yourself, rather than just using VSCode-YAML as an extension dependency and having that spawn it. If you are doing this because there are some API's missing that you need then please let me know.

The only reason I bring this up is this has been done before and it will eventually lead into multiple language servers running for a yaml file if the user has vscode-yaml and this extension installed. This can create several unintended results like duplicate completions, etc etc.

Too many failures in last 3 weeks: Couldn't get repository details.

Couldn't get repository details. Ensure your repo is hosted on Azure Repos or GitHub.

https://dataexplorer.azure.com/clusters/ddtelvscode/databases/VSCodeExt?query=H4sIAAAAAAAAA31TTU9qMRDd8ytqN0KiYuLSYPLCM083hniNLk29HbBa2mamBTHG3+4UvJcK17fsnI85004tREFRYYxmDmIk1Mz3z0714LxnGbmhVNdANE3239WDx9ep9Utm3arl5QJcpPtq7DVcvsXeh1g+A4KoABeAd+zGtvMgLrb2LWejqtjYeHetxcFIHJKfw72yCU6oqR+2Am4ALhdvVE45ElK9J4RjDcH6ldzycqhOzrD2bmpmuVCbWh8HE8AaB1kL2V2LgD4QDxcUEjy+kHf9CZcAowEabHkIwTN3YTQg06OniMbN+mv9SYkWohef0MHK6H1FCxX0OiHyKImAiSHFfdUu40dASrZDsqnvd6kihF8bEIOFhNIT1WhC5MfoGuYnXgibC1cWQelV+xwdHr9SCztA9Mg7RmoG+w4lOugNh81+/CfEp5ARE+/Dlr0zK2+pLOHy9g6M+xR9OX6G+vXaTZrlOpJjbhThj9O3qSgLOeHAzXnN4R5SHMm/hoJVq41Mt4pyiO/nzXGq/D1Bg5bnvR04DzRVxq6xzn/8BSuDxNX7AwAA

let starttime = ago(30d);
let NsuccessfulGHWorkflow = RawEventsVSCodeExt
| where ServerTimestamp > starttime
| where VSCodeSessionId != 'someValue.sessionId'
| where ExtensionName == "azure-deploy"
| where EventName == "azure-deploy/configure-cicd-pipeline"
| extend props = parse_json(Properties)
| extend repoprovider = tostring(props.repoprovider)
| extend journeyid = tostring(props.journeyid)
| extend currentuserinput = tostring(props.currentuserinput)
| extend result = tostring(props.result)
| extend currentStep = tostring(props.currentstep)
| extend subscriptionid = tostring(props.subscriptionid)
| extend pipelinealreadyconfigured = tostring(props.pipelinealreadyconfigured)
| extend errormessage = tostring(props.errormessage)
//| where pipelinealreadyconfigured =~ "true"
//| where subscriptionid != ""
//| where currentStep !in~ ("CheckInPipeline","CreateAndRunPipeline", "PostPipelineCreation" ,"DisplayCreatedPipeline")
| where result =~ "failed";
NsuccessfulGHWorkflow

@kanika1894 Please check this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.