Skip to content

Commit cd11ccd

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/azure-docs-pr (branch live)
2 parents ba83f79 + dda9fc6 commit cd11ccd

File tree

6 files changed

+55
-51
lines changed

6 files changed

+55
-51
lines changed

articles/azure-functions/functions-reference-python.md

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -331,28 +331,66 @@ To build your dependencies and publish using a continuous delivery (CD) system,
331331

332332
## Unit Testing
333333

334-
Functions written in Python can be tested like other Python code using standard testing frameworks. For most bindings, it's possible to create a mock input object by creating an instance of an appropriate class from the `azure.functions` package.
334+
Functions written in Python can be tested like other Python code using standard testing frameworks. For most bindings, it's possible to create a mock input object by creating an instance of an appropriate class from the `azure.functions` package. Since the [`azure.functions`](https://pypi.org/project/azure-functions/) package is not immediately available, be sure to install it via your `requirements.txt` file as described in [Python version and package management](#python-version-and-package-management) section above.
335335

336336
For example, following is a mock test of an HTTP triggered function:
337337

338+
```json
339+
{
340+
"scriptFile": "httpfunc.py",
341+
"entryPoint": "my_function",
342+
"bindings": [
343+
{
344+
"authLevel": "function",
345+
"type": "httpTrigger",
346+
"direction": "in",
347+
"name": "req",
348+
"methods": [
349+
"get",
350+
"post"
351+
]
352+
},
353+
{
354+
"type": "http",
355+
"direction": "out",
356+
"name": "$return"
357+
}
358+
]
359+
}
360+
```
361+
338362
```python
339-
# myapp/__init__.py
363+
# myapp/httpfunc.py
340364
import azure.functions as func
341365
import logging
342366

367+
def my_function(req: func.HttpRequest) -> func.HttpResponse:
368+
logging.info('Python HTTP trigger function processed a request.')
343369

344-
def main(req: func.HttpRequest,
345-
obj: func.InputStream):
346-
347-
logging.info(f'Python HTTP triggered function processed: {obj.read()}')
370+
name = req.params.get('name')
371+
if not name:
372+
try:
373+
req_body = req.get_json()
374+
except ValueError:
375+
pass
376+
else:
377+
name = req_body.get('name')
378+
379+
if name:
380+
return func.HttpResponse(f"Hello {name}")
381+
else:
382+
return func.HttpResponse(
383+
"Please pass a name on the query string or in the request body",
384+
status_code=400
385+
)
348386
```
349387

350388
```python
351-
# myapp/test_func.py
389+
# myapp/test_httpfunc.py
352390
import unittest
353391

354392
import azure.functions as func
355-
from . import my_function
393+
from httpfunc import my_function
356394

357395

358396
class TestFunction(unittest.TestCase):
@@ -361,7 +399,7 @@ class TestFunction(unittest.TestCase):
361399
req = func.HttpRequest(
362400
method='GET',
363401
body=None,
364-
url='/my_function',
402+
url='/api/HttpTrigger',
365403
params={'name': 'Test'})
366404

367405
# Call the function.
@@ -370,7 +408,7 @@ class TestFunction(unittest.TestCase):
370408
# Check the output.
371409
self.assertEqual(
372410
resp.get_body(),
373-
'Hello, Test!',
411+
b'Hello Test',
374412
)
375413
```
376414

articles/backup/backup-azure-backup-faq.md

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dcurwin
66
manager: carmonm
77
ms.service: backup
88
ms.topic: conceptual
9-
ms.date: 01/08/2019
9+
ms.date: 07/07/2019
1010
ms.author: dacurwin
1111
---
1212

@@ -46,37 +46,6 @@ No. A Recovery Services vault can only change storage options before any backups
4646
- For the agent used to backup up Azure file folders, read this [FAQ](backup-azure-file-folder-backup-faq.md).
4747

4848

49-
## VMware and Hyper-V backup
50-
51-
### Can I back up VMware vCenter servers to Azure?
52-
Yes. You can use Azure Backup Server to back up VMware vCenter Server and ESXi hosts to Azure.
53-
54-
- [Learn more](backup-mabs-protection-matrix.md) about supported versions.
55-
- [Follow these steps](backup-azure-backup-server-vmware.md) to back up a VMware server.
56-
57-
### Do I need a separate license to recover an full on-premises VMware/Hyper-V cluster?
58-
You don't need separate licensing for VMware/Hyper-V protection.
59-
60-
- If you're a System Center customer, use System Center Data Protection Manager (DPM) to protect VMware VMs.
61-
- If you aren't a System Center customer, you can use Azure Backup Server (pay-as-you-go) to protect VMware VMs.
62-
63-
## DPM and Azure Backup Server backup
64-
65-
### Which DPM versions are supported?
66-
Supported DPM versions are summarized in the [support matrix](backup-azure-dpm-introduction.md#prerequisites-and-limitations). We recommend that you install the latest DPM updates, and run the [latest version](https://aka.ms/azurebackup_agent) of the Azure Backup agent on the DPM server.
67-
68-
### Can I register the server to multiple vaults?
69-
No. A DPM or Azure Backup server can be registered to only one vault.
70-
71-
### Can I use Azure Backup Server to create a Bare Metal Recovery (BMR) backup for a physical server? <br/>
72-
Yes.
73-
74-
### Can I use DPM to back up apps in Azure Stack?
75-
No. You can use Azure Backup to protect Azure Stack, Azure Backup doesn't support using DPM to back up apps in Azure Stack.
76-
77-
### If I've installed Azure Backup agent to protect my files and folders, can I install System Center DPM to back up on-premises workloads to Azure?
78-
Yes. But you should set up DPM first, and then install the Azure Backup agent. Installing components in this order ensures that the Azure Backup agent works with DPM. Installing the agent before installing DPM isn't advised or supported.
79-
8049
## General backup
8150

8251
### Are there limits on backup scheduling?
@@ -113,7 +82,7 @@ For Azure VM Linux backups, Azure Backup supports [the list of distributions end
11382
Sizes limits are as follows:
11483

11584
OS/machine | Size limit of data source
116-
--- | ---
85+
--- | ---
11786
Windows 8 or later | 54,400 GB
11887
Windows 7 |1700 GB
11988
Windows Server 2012 or later | 54,400 GB

articles/cosmos-db/how-to-manage-consistency.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@ Consistency level can be set on a per request, which overrides the default consi
6969

7070
```csharp
7171
// Override consistency at the client level
72-
ConsistencyPolicy consistencyPolicy = new ConsistencyPolicy
73-
{
74-
DefaultConsistencyLevel = ConsistencyLevel.BoundedStaleness,
75-
MaxStalenessIntervalInSeconds = 5,
76-
MaxStalenessPrefix = 100
77-
};
78-
documentClient = new DocumentClient(new Uri(endpoint), authKey, connectionPolicy, consistencyPolicy);
72+
documentClient = new DocumentClient(new Uri(endpoint), authKey, connectionPolicy, ConsistencyLevel.Eventual);
7973

8074
// Override consistency at the request level via request options
8175
RequestOptions requestOptions = new RequestOptions { ConsistencyLevel = ConsistencyLevel.Strong };

articles/expressroute/expressroute-howto-routing-portal-resource-manager.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ This section helps you create, get, update, and delete the Azure private peering
128128
* A /30 subnet for the secondary link. The subnet must not be part of any address space reserved for virtual networks. From this subnet you will assign the first useable IP address to your router as Microsoft uses the second useable IP for its router.
129129
* A valid VLAN ID to establish this peering on. Ensure that no other peering in the circuit uses the same VLAN ID. For both Primary and Secondary links you must use the same VLAN ID.
130130
* AS number for peering. You can use both 2-byte and 4-byte AS numbers. You can use a private AS number for this peering except for the number from 65515 to 65520, inclusively.
131+
* You must advertise the routes from your on-premises Edge router to Azure via BGP when you set up the private peering.
131132
* **Optional -** An MD5 hash if you choose to use one.
132133
3. Select the Azure private peering row, as shown in the following example:
133134

articles/iot-central/howto-set-up-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ assetloc: {
146146

147147
## Settings
148148

149-
Settings control a device. They enable operators to provide inputs to the device. You can add multiple settings to your device template that appear as tiles on the **Settings** tab for operators to use. You can add many types of settings: number, text, date, toggle, pick list, and section label.
149+
Settings control a device. They enable operators to provide inputs to the device. You can add multiple settings to your device template that appear as tiles on the **Settings** tab for operators to use. You can add many types of settings: number, text, date, toggle, and section label.
150150

151151
Settings can be in one of three states. The device reports these states.
152152

articles/machine-learning/service/tutorial-auto-train-models.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,8 @@ print(y_predict[:10])
11251125
Create a scatter plot to visualize the predicted cost values compared to the actual cost values. The following code uses the `distance` feature as the x-axis and trip `cost` as the y-axis. To compare the variance of predicted cost at each trip distance value, the first 100 predicted and actual cost values are created as separate series. Examining the plot shows that the distance/cost relationship is nearly linear, and the predicted cost values are in most cases very close to the actual cost values for the same trip distance.
11261126

11271127
```python
1128+
%matplotlib inline
1129+
11281130
import matplotlib.pyplot as plt
11291131

11301132
fig = plt.figure(figsize=(14, 10))

0 commit comments

Comments
 (0)