You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-reference-powershell.md
+43-37Lines changed: 43 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -473,43 +473,9 @@ Managing modules in Azure Functions written in PowerShell can be approached in t
473
473
474
474
The Managed Dependencies feature allows Azure Functions to automatically download and manage PowerShell modules specified in the `requirements.psd1` file. This is enabled by default in new PowerShell function apps.
475
475
476
-
#### Enabling Managed Dependencies
477
-
478
-
To enable managed dependencies, set the `managedDependency` property to `true` in the `host.json` file:
479
-
480
-
```json
481
-
{
482
-
"managedDependency": {
483
-
"enabled": true
484
-
}
485
-
}
486
-
```
487
-
488
-
#### Target Specific Versions
489
-
490
-
When targeting specific module versions, it’s important to follow both steps below to ensure the correct module version is loaded:
491
-
492
-
1.**Specify the module version in `requirements.psd1`:**
This ensures the specified version is loaded when your function starts.
507
-
508
-
#### Dependency Management Considerations
509
-
510
-
- **Internet Access**: Managed dependencies require access to `https://www.powershellgallery.com` to download modules. Ensure that your environment allows this access.
511
-
- **License Acceptance**: Modules that require license acceptance are not supported by managed dependencies.
512
-
- **Flex Consumption Plan**: Managed dependencies are not supported in the Flex Consumption plan. Use custom modules instead.
478
+
Content Here
513
479
514
480
#### Dependency Management App Settings
515
481
@@ -571,7 +537,47 @@ PSFunctionApp
571
537
| - requirements.psd1
572
538
```
573
539
574
-
Modules in the `Modules` folder are automatically available to the runtime.
540
+
When you start your function app, the PowerShell language worker adds this `Modules` folder to the `$env:PSModulePath` so that you can rely on module autoloading just as you would in a regular PowerShell script.
541
+
542
+
### Troubleshooting Managed Dependencies
543
+
544
+
#### Enabling Managed Dependencies
545
+
546
+
In order for Managed Dependencies to function, the feature must be enabled in host.json:
547
+
548
+
```json
549
+
{
550
+
"managedDependency": {
551
+
"enabled": true
552
+
}
553
+
}
554
+
```
555
+
556
+
#### Target Specific Versions
557
+
558
+
When targeting specific module versions, it’s important to follow both steps below to ensure the correct module version is loaded:
559
+
560
+
1.**Specify the module version in `requirements.psd1`:**
This ensures the specified version is loaded when your function starts.
575
+
576
+
#### Dependency Management Considerations
577
+
578
+
- **Internet Access**: Managed dependencies require access to `https://www.powershellgallery.com` to download modules. Ensure that your environment allows this access.
579
+
- **License Acceptance**: Modules that require license acceptance are not supported by managed dependencies.
580
+
- **Flex Consumption Plan**: Managed dependencies are not supported in the Flex Consumption plan. Use custom modules instead.
0 commit comments