Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Azure DevOps Task (setup-azd) to todo templates #2701

Merged
merged 2 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions templates/common/.azdo/pipelines/bicep/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,38 @@ trigger:

# Azure Pipelines workflow to deploy to Azure using azd
# To configure required secrets for connecting to Azure, simply run `azd pipeline config --provider azdo`
# Task "Install azd" needs to install setup-azd extension for azdo - https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd

pool:
vmImage: ubuntu-latest

# Use azd provided container image that has azd, infra, multi-language build tools pre-installed.
container: mcr.microsoft.com/azure-dev-cli-apps:latest

steps:
- task: setup-azd@0
displayName: Install azd

- pwsh: |
azd config set auth.useAzCliAuth "true"
displayName: Configure AZD to Use AZ CLI Authentication.
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;

azd auth login `
--client-id "$($info.clientId)" `
--client-secret "$($info.clientSecret)" `
--tenant-id "$($info.tenantId)"
displayName: azd login
env:
AZURE_CREDENTIALS: $(AZURE_CREDENTIALS)

- task: AzureCLI@2
- pwsh: |
azd provision --no-prompt
displayName: Provision Infrastructure
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd provision --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)

- task: AzureCLI@2

- pwsh: |
azd deploy --no-prompt
displayName: Deploy Application
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd deploy --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)
AZURE_LOCATION: $(AZURE_LOCATION)
49 changes: 49 additions & 0 deletions templates/common/.azdo/pipelines/java/azure-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Run when commits are pushed to mainline branch (main or master)
# Set this to the mainline branch you are using
trigger:
- main
- master

# Azure Pipelines workflow to deploy to Azure using azd
# To configure required secrets for connecting to Azure, simply run `azd pipeline config --provider azdo`
# Task "Install azd" needs to install setup-azd extension for azdo - https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd

pool:
vmImage: ubuntu-latest

steps:
- task: setup-azd@0
displayName: Install azd

- task: JavaToolInstaller@0
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'

- pwsh: |
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;

azd auth login `
--client-id "$($info.clientId)" `
--client-secret "$($info.clientSecret)" `
--tenant-id "$($info.tenantId)"
displayName: azd login
env:
AZURE_CREDENTIALS: $(AZURE_CREDENTIALS)

- pwsh: |
azd provision --no-prompt
displayName: Provision Infrastructure
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)

- pwsh: |
azd deploy --no-prompt
displayName: Deploy Application
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)
28 changes: 16 additions & 12 deletions templates/common/.azdo/pipelines/terraform/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@ trigger:

# Azure Pipelines workflow to deploy to Azure using azd
# To configure required secrets for connecting to Azure, simply run `azd pipeline config --provider azdo`
# Task "Install azd" needs to install setup-azd extension for azdo - https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd

pool:
vmImage: ubuntu-latest

# Use azd provided container image that has azd, infra, multi-language build tools pre-installed.
container: mcr.microsoft.com/azure-dev-cli-apps:latest

steps:
- task: setup-azd@0
displayName: Install azd

- pwsh: |
azd config set auth.useAzCliAuth "true"
displayName: Configure AZD to Use AZ CLI Authentication.
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;

azd auth login `
--client-id "$($info.clientId)" `
--client-secret "$($info.clientSecret)" `
--tenant-id "$($info.tenantId)"
displayName: azd login
env:
AZURE_CREDENTIALS: $(AZURE_CREDENTIALS)

- pwsh: |
azd config set alpha.terraform on
Expand All @@ -41,15 +49,11 @@ steps:
RS_STORAGE_ACCOUNT: $(RS_STORAGE_ACCOUNT)
RS_CONTAINER_NAME: $(RS_CONTAINER_NAME)

- task: AzureCLI@2
- pwsh: |
azd deploy --no-prompt
displayName: Deploy Application
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd deploy --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)

65 changes: 65 additions & 0 deletions templates/common/.azdo/pipelines/terraform/java/azure-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Run when commits are pushed to mainline branch (main or master)
# Set this to the mainline branch you are using
trigger:
- main
- master

# Azure Pipelines workflow to deploy to Azure using azd
# To configure required secrets for connecting to Azure, simply run `azd pipeline config --provider azdo`
# Task "Install azd" needs to install setup-azd extension for azdo - https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd

pool:
vmImage: ubuntu-latest

steps:
- task: setup-azd@0
displayName: Install azd

- pwsh: |
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;

azd auth login `
--client-id "$($info.clientId)" `
--client-secret "$($info.clientSecret)" `
--tenant-id "$($info.tenantId)"
displayName: azd login
env:
AZURE_CREDENTIALS: $(AZURE_CREDENTIALS)

- pwsh: |
azd config set alpha.terraform on
displayName: Enable terraform alpha feature from azd

- task: JavaToolInstaller@0
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'

- task: AzureCLI@2
displayName: Provision Infrastructure
inputs:
azureSubscription: azconnection
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
azd provision --no-prompt
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)
ARM_TENANT_ID: $(ARM_TENANT_ID)
ARM_CLIENT_ID: $(ARM_CLIENT_ID)
ARM_CLIENT_SECRET: $(ARM_CLIENT_SECRET)
RS_RESOURCE_GROUP: $(RS_RESOURCE_GROUP)
RS_STORAGE_ACCOUNT: $(RS_STORAGE_ACCOUNT)
RS_CONTAINER_NAME: $(RS_CONTAINER_NAME)

- pwsh: |
azd deploy --no-prompt
displayName: Deploy Application
env:
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
AZURE_ENV_NAME: $(AZURE_ENV_NAME)
AZURE_LOCATION: $(AZURE_LOCATION)

2 changes: 2 additions & 0 deletions templates/todo/projects/csharp-cosmos-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/csharp-sql-swa-func/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/csharp-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ repo:
- .azdo/pipelines/*/azure-dev.yml

# AzDo workflows for bicep
- from: ../../../../../common/.azdo/pipelines/bicep/azure-dev.yml
- from: ../../../../../common/.azdo/pipelines/java/azure-dev.yml
to: ./.azdo/pipelines/azure-dev.yml

# Github workflows for bicep
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/java-mongo-aca/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
2 changes: 1 addition & 1 deletion templates/todo/projects/java-mongo/.repo/bicep/repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ repo:
- .azdo/pipelines/*/azure-dev.yml

# AzDo workflows for bicep
- from: ../../../../../common/.azdo/pipelines/bicep/azure-dev.yml
- from: ../../../../../common/.azdo/pipelines/java/azure-dev.yml
to: ./.azdo/pipelines/azure-dev.yml

# Github workflows for bicep
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/java-mongo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ repo:
- .azdo/pipelines/*/azure-dev.yml

# AzDo workflows for terraform
- from: ../../../../../common/.azdo/pipelines/terraform/azure-dev.yml
- from: ../../../../../common/.azdo/pipelines/terraform/java/azure-dev.yml
to: ./.azdo/pipelines/azure-dev.yml

# Github workflows for terraform
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/java-postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/nodejs-mongo-aca/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/nodejs-mongo-aks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ This template also includes Kubernetes deployment manifests in the `manifests/`

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/nodejs-mongo-swa-func/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
2 changes: 2 additions & 0 deletions templates/todo/projects/nodejs-mongo/.repo/bicep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ This template is structured to follow the [Azure Developer CLI](https://aka.ms/a

At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ At this point, you have a complete application deployed on Azure. But there is m

- [`azd pipeline config`](https://learn.microsoft.com/azure/developer/azure-developer-cli/configure-devops-pipeline?tabs=GitHub) - to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

> Note: Needs to manually install [setup-azd extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.azd) for Azure DevOps (azdo).

- [`azd monitor`](https://learn.microsoft.com/azure/developer/azure-developer-cli/monitor-your-app) - to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)

- [Run and Debug Locally](https://learn.microsoft.com/azure/developer/azure-developer-cli/debug?pivots=ide-vs-code) - using Visual Studio Code and the Azure Developer CLI extension
Expand Down
Loading