Skip to content

Commit 80c37cb

Browse files
authored
Merge pull request #113736 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to master to sync with https://github.com/Microsoft/azure-docs (branch master)
2 parents 5bdca3c + 49407fa commit 80c37cb

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

articles/application-gateway/key-vault-certs.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,21 @@ Application Gateway integration with Key Vault requires a three-step configurati
4545
You then either import an existing certificate or create a new one in your key vault. The certificate will be used by applications that run through the application gateway. In this step, you can also use a key vault secret that's stored as a password-less, base-64 encoded PFX file. We recommend using a certificate type because of the autorenewal capability that's available with certificate type objects in the key vault. After you've created a certificate or a secret, you define access policies in the key vault to allow the identity to be granted *get* access to the secret.
4646

4747
> [!NOTE]
48-
> If you deploy the application gateway via an ARM template, either by using the Azure CLI or PowerShell, or via an Azure Application deployed from the Azure portal, the SSL certificate that's stored in the key vault as a base-64-encoded PFX file **must be passwordless**. Also, you must complete the steps in [Use Azure Key Vault to pass secure parameter value during deployment](../azure-resource-manager/templates/key-vault-parameter.md). It's particularly important to set `enabledForTemplateDeployment` to `true`.
48+
> If you deploy the application gateway via an ARM template, either by using the Azure CLI or PowerShell, or via an Azure application deployed from the Azure portal, the SSL certificate is stored in the key vault as a base64-encoded PFX file. You must complete the steps in [Use Azure Key Vault to pass secure parameter value during deployment](../azure-resource-manager/templates/key-vault-parameter.md).
49+
>
50+
> It's particularly important to set `enabledForTemplateDeployment` to `true`. The certificate may be passwordless or it may have a password. In the case of a certificate with a password, the following example shows a possible configuration for the `sslCertificates` entry in the `properties` for the ARM template configuration for an app gateway. The values of `appGatewaySSLCertificateData` and `appGatewaySSLCertificatePassword` are looked up from the key vault as described in the section [Reference secrets with dynamic ID](../azure-resource-manager/templates/key-vault-parameter.md#reference-secrets-with-dynamic-id). Follow the references backward from `parameters('secretName')` to see how the lookup happens. If the certificate is passwordless, omit the `password` entry.
51+
>
52+
> ```
53+
> "sslCertificates": [
54+
> {
55+
> "name": "appGwSslCertificate",
56+
> "properties": {
57+
> "data": "[parameters('appGatewaySSLCertificateData')]",
58+
> "password": "[parameters('appGatewaySSLCertificatePassword')]"
59+
> }
60+
> }
61+
> ]
62+
> ```
4963
5064
1. **Configure the application gateway**
5165

articles/batch/batch-sig-images.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,71 @@ private static void CreateBatchPool(BatchClient batchClient, VirtualMachineConfi
125125
}
126126
```
127127

128+
## Create a pool from a Shared Image using Python
129+
130+
You also can create a pool from a Shared Image by using the Python SDK:
131+
132+
```python
133+
# Import the required modules from the
134+
# Azure Batch Client Library for Python
135+
import azure.batch as batch
136+
import azure.batch.models as batchmodels
137+
from azure.common.credentials import ServicePrincipalCredentials
138+
139+
# Specify Batch account and service principal account credentials
140+
account = "{batch-account-name}"
141+
batch_url = "{batch-account-url}"
142+
ad_client_id = "{sp-client-id}"
143+
ad_tenant = "{tenant-id}"
144+
ad_secret = "{sp-secret}"
145+
146+
# Pool settings
147+
pool_id = "LinuxNodesSamplePoolPython"
148+
vm_size = "STANDARD_D2_V3"
149+
node_count = 1
150+
151+
# Initialize the Batch client with Azure AD authentication
152+
creds = ServicePrincipalCredentials(
153+
client_id=ad_client_id,
154+
secret=ad_secret,
155+
tenant=ad_tenant,
156+
resource="https://batch.core.windows.net/"
157+
)
158+
client = batch.BatchServiceClient(creds, batch_url)
159+
160+
# Configure the start task for the pool
161+
start_task = batchmodels.StartTask(
162+
command_line="printenv AZ_BATCH_NODE_STARTUP_DIR"
163+
)
164+
start_task.run_elevated = True
165+
166+
# Create an ImageReference which specifies the image from
167+
# Shared Image Gallery to install on the nodes.
168+
ir = batchmodels.ImageReference(
169+
virtual_machine_image_id="/subscriptions/{sub id}/resourceGroups/{resource group name}/providers/Microsoft.Compute/galleries/{gallery name}/images/{image definition name}/versions/{version id}"
170+
)
171+
172+
# Create the VirtualMachineConfiguration, specifying
173+
# the VM image reference and the Batch node agent to
174+
# be installed on the node.
175+
vmc = batchmodels.VirtualMachineConfiguration(
176+
image_reference=ir,
177+
node_agent_sku_id="batch.node.ubuntu 18.04"
178+
)
179+
180+
# Create the unbound pool
181+
new_pool = batchmodels.PoolAddParameter(
182+
id=pool_id,
183+
vm_size=vm_size,
184+
target_dedicated_nodes=node_count,
185+
virtual_machine_configuration=vmc,
186+
start_task=start_task
187+
)
188+
189+
# Create pool in the Batch service
190+
client.pool.add(new_pool)
191+
```
192+
128193
## Create a pool from a Shared Image using the Azure portal
129194

130195
Use the following steps to create a pool from a Shared Image in the Azure portal.

0 commit comments

Comments
 (0)