Skip to content

Commit 2cc19b9

Browse files
chore: streamline logging across modules (#351)
Co-authored-by: Pim Simons <32359437+pim-simons@users.noreply.github.com>
1 parent 9186497 commit 2cc19b9

33 files changed

Lines changed: 291 additions & 497 deletions

docs/preview/03-Features/powershell/azure-api-management.md

Lines changed: 26 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ PS> Backup-AzApiManagementService `
3939
-StorageAccountName "my-storage-account" `
4040
-ServiceName "my-service" `
4141
-ContainerName "my-target-blob-container"
42-
# Getting Azure storage account key..
43-
# Got Azure storage key!
44-
# Create new Azure storage context with storage key...
45-
# New Azure storage context with storage key created!
46-
# Start backing up API management service...
47-
# API management service is backed-up!
42+
# New Azure storage context for storage account 'my-storage-account' with storage key created!
43+
# Azure API management service 'my-service' in resource group 'my-resource-group' is backed-up!
4844
```
4945

5046
## Creating a new API operation in the Azure API Management instance
@@ -75,7 +71,7 @@ PS> Create-AzApiManagementApiOperation `
7571
-OperationId $OperationId `
7672
-Method $Method `
7773
-UrlTemplate $UrlTemplate
78-
# New API operation '$OperationName' on Azure API Management instance was added.
74+
# New API operation '$OperationName' was added on Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
7975
```
8076

8177
Creates a new API operation on the Azure API Management instance with using a specific operation policy.
@@ -91,12 +87,13 @@ PS> Create-AzApiManagementApiOperation `
9187
-OperationName $OperationName `
9288
-Description $Description `
9389
-PolicyFilePath $PolicyFilePath
94-
# New API operation '$OperationName' on API Management instance was added.
90+
# New API operation '$OperationName' was added on Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
91+
# Updated policy of the operation '$OperationId' in API '$ApiId' of the Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
9592
```
9693

9794
## Creating a new user in an Azure API Management service
9895

99-
Signup or invite a new user in an existing Azure API Management instance.
96+
Sign-up or invite a new user in an existing Azure API Management instance.
10097

10198
| Parameter | Mandatory | Description |
10299
| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -125,8 +122,7 @@ PS> Create-AzApiManagementUserAccount `
125122
-FirstName $FirstName `
126123
-LastName $LastName `
127124
-MailAddress $MailAddress
128-
# Attempting to invite $FirstName $LastName ($MailAddress)
129-
# Invitation has been sent to FirstName $LastName ($MailAddress)
125+
# Invitation has been sent to $FirstName $LastName ($mailAddress) for Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
130126
```
131127

132128
Invite a new user in an existing Azure API Management instance and specify a UserId.
@@ -139,8 +135,7 @@ PS> Create-AzApiManagementUserAccount `
139135
-LastName $LastName `
140136
-MailAddress $MailAddress `
141137
-UserId $UserId
142-
# Attempting to invite $FirstName $LastName ($MailAddress)
143-
# Invitation has been sent to FirstName $LastName ($MailAddress)
138+
# Invitation has been sent to $FirstName $LastName ($mailAddress) for Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
144139
```
145140

146141
Invite a new user in an existing Azure API Management instance and include a note.
@@ -153,8 +148,7 @@ PS> Create-AzApiManagementUserAccount `
153148
-LastName $LastName `
154149
-MailAddress $MailAddress `
155150
-Note $Note
156-
# Attempting to invite $FirstName $LastName ($MailAddress)
157-
# Invitation has been sent to FirstName $LastName ($MailAddress)
151+
# Invitation has been sent to $FirstName $LastName ($mailAddress) for Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
158152
```
159153

160154
Invite a new user in an existing Azure API Management instance and send a notification.
@@ -167,8 +161,7 @@ PS> Create-AzApiManagementUserAccount `
167161
-LastName $LastName `
168162
-MailAddress $MailAddress `
169163
-SendNotification
170-
# Attempting to invite $FirstName $LastName ($MailAddress)
171-
# Invitation has been sent to FirstName $LastName ($MailAddress)
164+
# Invitation has been sent to $FirstName $LastName ($mailAddress) for Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
172165
```
173166

174167
Signup a new user in an existing Azure API Management instance.
@@ -181,8 +174,7 @@ PS> Create-AzApiManagementUserAccount `
181174
-LastName $LastName `
182175
-MailAddress $MailAddress `
183176
-ConfirmationType signup
184-
# Attempting to create account for FirstName $LastName ($MailAddress)
185-
# Account has been created for FirstName $LastName ($MailAddress)
177+
# Account has been created for $FirstName $LastName ($mailAddress) for Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
186178
# Since no password was provided, one has been generated. Please advise the user to change this password the first time logging in
187179
```
188180

@@ -197,8 +189,7 @@ PS> Create-AzApiManagementUserAccount `
197189
-MailAddress $MailAddress `
198190
-Password $Password `
199191
-ConfirmationType signup
200-
# Attempting to create account for FirstName $LastName ($MailAddress)
201-
# Account has been created for FirstName $LastName ($MailAddress)
192+
# Account has been created for $FirstName $LastName ($mailAddress) for Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
202193
```
203194

204195
## Removing a user from an Azure API Management service
@@ -222,9 +213,7 @@ PS> Remove-AzApiManagementUserAccount `
222213
-ResourceGroupName $ResourceGroup `
223214
-ServiceName $ServiceName `
224215
-MailAddress $MailAddress
225-
# Retrieving the user account with e-mail '$MailAddress'
226-
# Attempting to remove the user account with e-mail '$MailAddress' and id '1'
227-
# Removed the user account with e-mail '$MailAddress' and id '1'
216+
# Removed the user account with e-mail '$MailAddress' and ID '1' for the Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
228217
```
229218

230219
## Importing a policy to a product in the Azure API Management instance
@@ -244,7 +233,7 @@ PS> Import-AzApiManagementProductPolicy `
244233
-ServiceName $ServiceName `
245234
-ProductId $ProductId `
246235
-PolicyFilePath $PolicyFilePath
247-
# Updating policy of the product '$ProductId'
236+
# Successfully updated the product policy for the Azure API Management service $ServiceName in resource group $ResourceGroupName
248237
```
249238

250239
## Importing a policy to an API in the Azure API Management instance
@@ -264,7 +253,7 @@ PS> Import-AzApiManagementApiPolicy `
264253
-ServiceName $ServiceName `
265254
-ApiId $ApiId `
266255
-PolicyFilePath $PolicyFilePath
267-
# Updating policy of the API '$ApiId'
256+
# Successfully updated API policy for the Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
268257
```
269258

270259
## Importing a policy to an operation in the Azure API Management instance
@@ -286,7 +275,7 @@ PS> Import-AzApiManagementOperationPolicy `
286275
-ApiId $ApiId `
287276
-OperationId $OperationId `
288277
-PolicyFilePath $PolicyFilePath
289-
# Updating policy of the operation '$OperationId' in API '$ApiId'
278+
# USuccessfully updated the operation policy for the Azure API Management service $ServiceName in resource group $ResourceGroupName
290279
```
291280

292281
## Removing all Azure API Management defaults from the instance
@@ -302,9 +291,9 @@ Remove all default API's and products from the Azure API Management instance ('e
302291
PS> Remove-AzApiManagementDefaults `
303292
-ResourceGroupName $ResourceGroup `
304293
-ServiceName $ServiceName
305-
# Removing Echo Api...
306-
# Removing Starter product...
307-
# Removing Unlimited product...
294+
# Removed 'echo' API in the Azure API Management service $ServiceName in resource group $ResourceGroupName
295+
# Removed 'starter' product in the Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
296+
# Removed 'unlimited' product in the Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
308297
```
309298

310299
## Restoring an API Management service
@@ -330,12 +319,7 @@ PS> Restore-AzApiManagementService `
330319
-ServiceName $ServiceName `
331320
-ContainerName $ContainerName `
332321
-BlobName $BlobName
333-
# Getting Azure storage account key...
334-
# Got Azure storage key!
335-
# Create new Azure storage context with storage key...
336-
# New Azure storage context with storage key created!
337-
# Start restoring up API management service...
338-
# API management service is restored!
322+
# Azure API Management service '$ServiceName' in resource group '$ResourceGroupName' is restored!
339323
```
340324

341325
## Setting authentication keys to an API in the Azure API Management instance
@@ -357,9 +341,9 @@ PS> Set-AzApiManagementApiSubscriptionKey `
357341
-ResourceGroupName $ResourceGroup `
358342
-ServiceName $ServiceName `
359343
-ApiId $ApiId
360-
Write-Host "Using API Management instance '$ServiceName' in resource group '$ResourceGroup'"
361-
Write-Host "Subscription key header 'x-api-key' was assigned"
362-
Write-Host "Subscription key query parameter 'apiKey' was assigned"
344+
# Using API Management instance '$ServiceName' in resource group '$ResourceGroup'
345+
# Subscription key header 'x-api-key' was assigned
346+
# Subscription key query parameter 'apiKey' was assigned
363347
```
364348

365349
**User-defined values**
@@ -371,9 +355,8 @@ PS> Set-AzApiManagementApiSubscriptionKey `
371355
-ApiId $ApiId `
372356
-HeaderName "my-api-key" `
373357
-QueryParamName "myApiKey"
374-
Write-Host "Using API Management instance '$ServiceName' in resource group '$ResourceGroup'"
375-
Write-Host "Subscription key header 'my-api-key' was assigned"
376-
Write-Host "Subscription key query parameter 'myApiKey' was assigned"
358+
# Subscription key header 'my-api-key' was assigned for the Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
359+
# Subscription key query parameter 'myApiKey' was assigned for the Azure API Management service '$ServiceName' in resource group '$ResourceGroupName'
377360
```
378361

379362
## Uploading private certificates to the Azure API Management certificate store
@@ -395,6 +378,5 @@ PS> Upload-AzApiManagementCertificate `
395378
-ServiceName "my-api-management-instance" `
396379
-CertificateFilePath "c:\temp\certificate.pfx" `
397380
-CertificatePassword "P@ssw0rd"
398-
# Using API Management instance 'my-api-management-instance' in resource group 'my-resource-group'
399-
# Uploaded private certificate at 'c:\temp\certificate.pfx'
381+
# Uploaded private certificate at 'C:\temp\certificate.pfx' for the Azure API Management service 'my-api-management-instance' in resource group 'my-resource-group'
400382
```

docs/preview/03-Features/powershell/azure-data-factory.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PS> Enable-AzDataFactoryTrigger `
3131
-ResourceGroupName "my-resource-group" `
3232
-DataFactoryName "my-data-factory-name" `
3333
-DataFactoryTriggerName "my-data-factory-trigger-name"
34-
# The trigger 'my-data-factory-trigger-name' has been enabled.
34+
# Started Azure Data Factory trigger 'my-data-factory-trigger-name' of data factory 'my-data-factory-name' in resource group 'my-resource-group'
3535
```
3636

3737
```powershell
@@ -62,7 +62,7 @@ PS> Disable-AzDataFactoryTrigger `
6262
-ResourceGroupName "my-resource-group" `
6363
-DataFactoryName "my-data-factory-name" `
6464
-DataFactoryTriggerName "my-data-factory-trigger-name"
65-
# The trigger 'my-data-factory-trigger-name' has been disabled.
65+
# Stopped Azure Data Factory trigger 'my-data-factory-trigger-name' of data factory 'my-data-factory-name' in resource group 'my-resource-group'
6666
```
6767

6868
```powershell

docs/preview/03-Features/powershell/azure-devops.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ With default `ArmOutputs` environment variable containing: `"my-variable": "my-v
124124

125125
```powershell
126126
PS> Set-AzDevOpsArmOutputsToPipelineVariables
127-
# Get ARM outputs from 'ArmOutputs' environment variable
127+
# Getting ARM outputs from 'ArmOutputs' environment variable...
128128
# The pipeline variable my-variable will be updated to value my-value, so it can be used in subsequent tasks of the current job.
129129
# ##vso[task.setvariable variable=my-variable]my-value
130130
```
@@ -133,7 +133,7 @@ With custom `MyArmOutputs` environment variable containing: `"my-variable": "my-
133133

134134
```powershell
135135
PS> Set-AzDevOpsArmOutputsToPipelineVariables -ArmOutputsEnvironmentVariableName "MyArmOutputs"
136-
# Get ARM outputs from 'MyArmOutputs' environment variable
136+
# Getting ARM outputs from 'MyArmOutputs' environment variable...
137137
# The pipeline variable my-variable will be updated to value my-value, so it can be used in subsequent tasks of the current job.
138138
# ##vso[task.setvariable variable=my-variable]my-value
139139
```
@@ -176,10 +176,11 @@ Saves/retains a specific Azure DevOps pipeline run.
176176
PS> Save-AzDevOpsBuild `
177177
-ProjectId $(System.TeamProjectId) `
178178
-BuildId $(Build.BuildId)
179-
# The variables $(System.TeamProjectId) and $(Build.BuildId) are predefined Azure DevOps variables
180-
# Information on them can be found here: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
179+
# Saved Azure DevOps build with build ID $BuildId in project $ProjectId
181180
```
182181

182+
> 💡 The variables $(System.TeamProjectId) and $(Build.BuildId) are predefined Azure DevOps variables. Information on them can be found here: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
183+
183184
**Azure DevOps Example**
184185
This function is intended to be used from an Azure DevOps pipeline. Internally, it uses some predefined Azure DevOps variables.
185186
One of the environment variables that is used, is the `SYSTEM_ACCESSTOKEN` variable. However, due to safety reasons this variable is not available out-of-the box.

0 commit comments

Comments
 (0)