Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Release 1.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure-Fluent committed Jan 14, 2020
1 parent a7ba5f5 commit 88f771e
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 26 deletions.
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,44 @@ languages:
- java
products:
- azure
- azure-functions
description: "Azure App Service basic sample for managing function apps."
urlFragment: app-service-java-manage-authentication-for-functions
extensions:
- services: Appservice
- platforms: java
---

# Manage Function App With Authentication (Java)
# Getting Started with Appservice - Manage Function App With Authentication - in Java #

Azure App Service basic sample for managing function apps.

- Create 3 function apps under the same new app service plan and with the same storage account
- Deploy 1 & 2 via Git a function that calculates the square of a number
- Deploy 3 via Web Deploy
- Enable app level authentication for the 1st function app
- Verify the 1st function app can be accessed with the admin key
- Enable function level authentication for the 2nd function app
- Verify the 2nd function app can be accessed with the function key
- Enable function level authentication for the 3rd function app
- Verify the 3rd function app can be accessed with the function key
Azure App Service basic sample for managing function apps.
- Create 3 function apps under the same new app service plan and with the same storage account
- Deploy 1 & 2 via Git a function that calculates the square of a number
- Deploy 3 via Web Deploy
- Enable app level authentication for the 1st function app
- Verify the 1st function app can be accessed with the admin key
- Enable function level authentication for the 2nd function app
- Verify the 2nd function app can be accessed with the function key
- Enable function level authentication for the 3rd function app
- Verify the 3rd function app can be accessed with the function key


## Running this sample
## Running this Sample ##

To run this sample:

Set the environment variable `AZURE_AUTH_LOCATION` with the full path for an auth file. See [how to create an auth file](https://github.com/Azure/azure-libraries-for-java/blob/master/AUTH.md).

```bash
git clone https://github.com/Azure-Samples/app-service-java-manage-authentication-for-functions.git
cd app-service-java-manage-authentication-for-functions
mvn clean compile exec:java
```
git clone https://github.com/Azure-Samples/app-service-java-manage-authentication-for-functions.git

## More information
cd app-service-java-manage-authentication-for-functions

mvn clean compile exec:java

## More information ##

[http://azure.com/java](http://azure.com/java)

If you don't have a Microsoft Azure subscription you can get a FREE trial account [here](http://go.microsoft.com/fwlink/?LinkId=330212).
If you don't have a Microsoft Azure subscription you can get a FREE trial account [here](http://go.microsoft.com/fwlink/?LinkId=330212)

---

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.24.1</version>
<version>1.30.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
Expand All @@ -65,5 +65,15 @@
<artifactId>org.eclipse.jgit</artifactId>
<version>4.5.0.201609210915-r</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public static boolean runSample(Azure azure) {
System.out.println("Deploying a local function app to " + app3Name + " through web deploy...");

app3.deploy()
.withPackageUri("https://github.com/Azure/azure-sdk-for-java/raw/master/azure-samples/src/main/resources/square-function-app-function-auth.zip")
.withPackageUri("https://github.com/Azure/azure-libraries-for-java/raw/master/azure-samples/src/main/resources/square-function-app-function-auth.zip")
.withExistingDeploymentsDeleted(false)
.execute();

Expand Down
21 changes: 20 additions & 1 deletion src/main/java/com/microsoft/azure/management/samples/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,24 @@ public static void print(LoadBalancer resource) {
}
}

// Show HTTPS probes
info.append("\n\tHTTPS probes: ")
.append(resource.httpsProbes().size());
for (LoadBalancerHttpProbe probe : resource.httpsProbes().values()) {
info.append("\n\t\tProbe name: ").append(probe.name())
.append("\n\t\t\tPort: ").append(probe.port())
.append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds())
.append("\n\t\t\tRetries before unhealthy: ").append(probe.numberOfProbes())
.append("\n\t\t\tHTTPS request path: ").append(probe.requestPath());

// Show associated load balancing rules
info.append("\n\t\t\tReferenced from load balancing rules: ")
.append(probe.loadBalancingRules().size());
for (LoadBalancingRule rule : probe.loadBalancingRules().values()) {
info.append("\n\t\t\t\tName: ").append(rule.name());
}
}

// Show load balancing rules
info.append("\n\tLoad balancing rules: ")
.append(resource.loadBalancingRules().size());
Expand Down Expand Up @@ -994,7 +1012,7 @@ public static void print(AppServicePlan resource) {
*/
public static void print(WebAppBase resource) {
StringBuilder builder = new StringBuilder().append("Web app: ").append(resource.id())
.append("Name: ").append(resource.name())
.append("\n\tName: ").append(resource.name())
.append("\n\tState: ").append(resource.state())
.append("\n\tResource group: ").append(resource.resourceGroupName())
.append("\n\tRegion: ").append(resource.region())
Expand Down Expand Up @@ -1377,6 +1395,7 @@ public static String createRandomName(String namePrefix) {
*/
public static void createCertificate(String certPath, String pfxPath,
String alias, String password, String cnName) throws Exception {
SdkContext.prepareFileLocation(new File(pfxPath), new File(certPath));
if (new File(pfxPath).exists()) {
return;
}
Expand Down

0 comments on commit 88f771e

Please sign in to comment.