Skip to content

Commit ee8aadc

Browse files
authored
Update AZD to 1.10.2 and add multi-tenant deployment instructions (#258)
* Add instructions for authenticating in multi-tenant scenarios * Update AZD to 1.10.2
1 parent dfddc71 commit ee8aadc

File tree

9 files changed

+52
-11
lines changed

9 files changed

+52
-11
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// - /.github/workflows/azure-dev.yml
3636
// - /.github/workflows/scheduled-azure-dev.yml
3737
// - /.github/workflows/scheduled-azure-teardown.yml
38-
"version": "1.10.1"
38+
"version": "1.10.2"
3939
},
4040
"ghcr.io/devcontainers/features/docker-in-docker:2": {
4141
"version": "latest"

.github/workflows/azure-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
container:
15-
image: mcr.microsoft.com/azure-dev-cli-apps:1.10.1
15+
image: mcr.microsoft.com/azure-dev-cli-apps:1.10.2
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v2

.github/workflows/scheduled-azure-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
build:
2121
runs-on: ubuntu-latest
2222
container:
23-
image: mcr.microsoft.com/azure-dev-cli-apps:1.10.1
23+
image: mcr.microsoft.com/azure-dev-cli-apps:1.10.2
2424
env:
2525
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
2626
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}

.github/workflows/scheduled-azure-teardown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
build:
2020
runs-on: ubuntu-latest
2121
container:
22-
image: mcr.microsoft.com/azure-dev-cli-apps:1.10.1
22+
image: mcr.microsoft.com/azure-dev-cli-apps:1.10.2
2323
env:
2424
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
2525
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ Import-Module Az.Resources
110110
Connect-AzAccount -UseDeviceAuthentication
111111
```
112112

113+
If you have multiple tenants, you can use the following command instead to login to the correct tenant:
114+
115+
```pwsh
116+
Connect-AzAccount -UseDeviceAuthentication -TenantId <tenant-id>
117+
```
118+
113119
Set the subscription to the one you want to use (you can use [Get-AzSubscription](https://learn.microsoft.com/powershell/module/az.accounts/get-azsubscription?view=azps-11.3.0) to list available subscriptions):
114120

115121
```pwsh
@@ -126,6 +132,12 @@ Use the next command to login with the Azure Dev CLI (AZD) tool:
126132
azd auth login --use-device-code
127133
```
128134

135+
If you have multiple tenants, you can use the following command instead to log into the correct tenant:
136+
137+
```pwsh
138+
azd auth login --use-device-code --tenant-id <tenant-id>
139+
```
140+
129141
### 4. Create a new environment
130142

131143
Next we provide the AZD tool with variables that it uses to create the deployment. The first thing we initialize is the AZD environment with a name.

infra/core/compute/postDeploymentScript/post-deployment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# install AZD - keep this version in sync with the version used in the file /.devcontainer/devcontainer.json file
4-
curl -fsSL https://aka.ms/install-azd.sh | bash -s -- -- version 1.10.1
4+
curl -fsSL https://aka.ms/install-azd.sh | bash -s -- -- version 1.10.2
55

66
# add Microsoft package feed for the dotnet install
77
# Get Ubuntu version

prerequisites.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The following tools are pre-requisites to running the associated deployment step
1313

1414
1. PowerShell users - [Install PowerShell](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows)
1515
Run the following to verify that you're running the latest PowerShell
16-
16+
1717
```ps1
1818
$PsVersionTable
1919
```
@@ -31,7 +31,7 @@ The following tools are pre-requisites to running the associated deployment step
3131
```ps1
3232
az version
3333
```
34-
34+
3535
After the installation, run the following command to [sign in to Azure PowerShell interactively](https://learn.microsoft.com/powershell/azure/authenticate-interactive).
3636
3737
```ps1
@@ -45,10 +45,10 @@ The following tools are pre-requisites to running the associated deployment step
4545
```
4646
4747
1. [Install the Azure Dev CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd).
48-
Run the following command to verify that the Azure Dev CLI is installed.
48+
Run the following command to verify that the Azure Dev CLI is installed and version 1.10.2 or higher.
4949
5050
```ps1
51-
azd auth login
51+
azd version
5252
```
5353
5454
1. [Install .NET 7 SDK](https://dotnet.microsoft.com/download/dotnet/7.0)
@@ -71,4 +71,4 @@ The following tools are pre-requisites to running the associated deployment step
7171
1. Docker Desktop
7272
1. VSCode
7373
1. VSCode ms-vscode-remote.remote-containers extension
74-
1. git
74+
1. git

prod-deployment.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ The following detailed deployment steps assume you are using a Dev Container ins
4242
```pwsh
4343
Connect-AzAccount -UseDeviceAuthentication
4444
```
45+
If you have multiple tenants, you can use the following command instead to login to the correct tenant:
46+
47+
```pwsh
48+
Connect-AzAccount -UseDeviceAuthentication -TenantId <tenant-id>
49+
```
4550

4651
1. Set the subscription to the one you want to use (you can use [Get-AzSubscription](https://learn.microsoft.com/powershell/module/az.accounts/get-azsubscription?view=azps-11.3.0) to list available subscriptions):
4752

@@ -60,6 +65,11 @@ The following detailed deployment steps assume you are using a Dev Container ins
6065
azd auth login --use-device-code
6166
```
6267

68+
If you have multiple tenants, you can use the following command instead to log into the correct tenant:
69+
70+
```pwsh
71+
azd auth login --use-device-code --tenant-id <tenant-id>
72+
```
6373

6474
### 2. Provision the app
6575

@@ -117,6 +127,12 @@ The following detailed deployment steps assume you are using a Dev Container ins
117127
```pwsh
118128
az login --use-device-code
119129
```
130+
131+
If you have multiple tenants, you can use the following command instead to log into the correct tenant:
132+
133+
```pwsh
134+
az login --use-device-code --tenant <tenant-id>
135+
```
120136

121137
```pwsh
122138
$AZURE_SUBSCRIPTION_ID = ((azd env get-values --output json | ConvertFrom-Json).AZURE_SUBSCRIPTION_ID)
@@ -207,6 +223,7 @@ The following detailed deployment steps assume you are using a Dev Container ins
207223
exit # exit the ssh connection
208224
ssh -F ./ssh-config 127.0.0.1 -p 50022
209225
pwsh
226+
cd web-app-pattern
210227
```
211228
212229
1. [Sign in to Azure PowerShell interactively](https://learn.microsoft.com/powershell/azure/authenticate-interactive):
@@ -215,6 +232,12 @@ The following detailed deployment steps assume you are using a Dev Container ins
215232
Connect-AzAccount -UseDeviceAuthentication
216233
```
217234
235+
If you have multiple tenants, you can use the following command instead to login to the correct tenant:
236+
237+
```pwsh
238+
Connect-AzAccount -UseDeviceAuthentication -TenantId <tenant-id>
239+
```
240+
218241
```pwsh
219242
Set-AzContext -SubscriptionId ((azd env get-values --output json | ConvertFrom-Json).AZURE_SUBSCRIPTION_ID)
220243
```
@@ -225,6 +248,12 @@ The following detailed deployment steps assume you are using a Dev Container ins
225248
azd auth login --use-device-code
226249
```
227250
251+
If you have multiple tenants, you can use the following command instead to log into the correct tenant:
252+
253+
```pwsh
254+
azd auth login --use-device-code --tenant-id <tenant-id>
255+
```
256+
228257
1. Deploy the application to the primary region using:
229258
230259
<!-- from PowerShell use the following command to deploy the code to the secondary region:

src/Relecloud.Messaging/Relecloud.Messaging.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Azure.Identity" Version="1.10.4" />
11+
<PackageReference Include="Azure.Identity" Version="1.11.4" />
1212
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.17.1" />
1313
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
1414
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />

0 commit comments

Comments
 (0)